<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        body{
            padding: 5rem;
        }
        h1{
            margin-bottom: 8rem;
        }
        .box{
            position: relative;
            perspective: 800px;
            transform-style: preserve-3d;
            perspective-origin: 100% 0;
            border: solid 1px #999;
            width: 600px;
            height: 400px;
        }
        .box > span{
            position: absolute;
            width: 200px;
            height: 200px;
            bottom: 0;
            font-size: 48px;
            color: #fff;
            display: flex;
            justify-content: center;
            align-items: center;
            border: solid 2px #222;
            box-sizing: border-box;
        }

        .front{
            background-color: rgba(255,0,0,.5);
        }
        .back{
            background-color: rgba(0,255,0,.5);
            transform: translateZ(-200px);
        }
        .left{
            background-color: rgba(0,0,255,.5);
            transform: rotateY(90deg) translateZ(-100px) translateX(100px);
        }
        .right{
            background-color: rgba(125,125,0,.5);
            transform: rotateY(90deg) translateZ(100px) translateX(100px);
        }
        .top{
            background-color: rgba(0,125,10,.5);
            transform: rotateX(90deg) translateZ(100px) translateY(-100px);
        }
        .bottom{
            background-color: rgba(125,0,125,.5);
            transform: rotateX(90deg) translateZ(-100px) translateY(-100px);
        }
    </style>
</head>
<body>
    <h1>Cube</h1>
    <div class="box">
        <span class="front">front</span>
        <span class="back">back</span>
        <span class="left">left</span>
        <span class="right">right</span>
        <span class="top">top</span>
        <span class="bottom">bottom</span>
    </div>
</body>
</html>